package com.kancy.vip.pattern.factory.abstractfactory;

import com.kancy.vip.pattern.factory.Phone;

/**
 * 同样是在AProductFactory基础上扩展功能 ComputerFactory
 *
 * 通过组合的方式，对AProductFactory进行扩展
 *
 * 尽量依赖接口编程，而不依赖具体实现类
 */
public class EProductFactory  implements ExtPhoneFactory {
    private PhoneFactory phoneFactory;

    public EProductFactory(PhoneFactory phoneFactory) {
        this.phoneFactory = phoneFactory;
    }

    @Override
    public Phone createXiaomi() {
        return null;
    }
    @Override
    public Phone createSanxing() {
        return phoneFactory.createSanxing();
    }
    @Override
    public Phone createHuawei() {
        return phoneFactory.createHuawei();
    }
}
